export default async function ({ app, store, redirect, error }) {
  try {
    const { data } = await app.$axios.get('http://localhost:8081/me')
    store.commit('setUserInfo', data)
  } catch (err) {
    store.commit('setUserInfo', undefined)
    if ([401, 403].indexOf(err.code) > -1 ) {
      redirect('/')
    }
  }
}
